﻿namespace zijian666.WorkScheduler.Defines;

/// <summary>
/// 表示一个工作进程。
/// </summary>
public readonly record struct WorkProgress(WorkData data)
{
    /// <summary>
    /// 获取工作标识。
    /// </summary>
    public string Id => Work.Id;
    /// <summary>
    /// 获取工作票据。
    /// </summary>
    public string Ticket => Work.Ticket;

    /// <summary>
    /// 获取工作数据。
    /// </summary>
    public WorkData Work { get; } = data;

    /// <summary>
    /// 获取当前工作状态。
    /// </summary>
    public required WorkStatus CurrentStatus { get; init; }

    public required double Progress { get; init; }

    public Exception? Exception { get; init; }

    public string? Result { get; init; }

    public string? Remark { get; init; }
}
